package com.joizhang.seckill.mapper;

import com.joizhang.seckill.model.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface GoodsMapper {

    @Select("select g.id from sk_goods g")
    List<Long> getGoodsIds();

    @Select("select g.* from sk_goods g")
    List<Goods> getGoodsList();

    @Select("select g.* from sk_goods g where g.id = ${goodsId}")
    Goods getGoodsByGoodsId(@Param("goodsId") long goodsId);

}
